package cn.wh.session;

import cn.wh.builder.xml.XMLConfigBuilder;
import cn.wh.session.defaults.DefaultSqlSessionFactory;

import java.io.Reader;

/**
 * @Author wh
 * @Description
 * @Date 2023/2/2 10:15
 * @Version 1.0
 **/
public class SqlSessionFactoryBuilder {
    public SqlSessionFactory build(Reader reader) {
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder(reader);
        return build(xmlConfigBuilder.parse());
    }

    public SqlSessionFactory build(Configuration config) {
        return new DefaultSqlSessionFactory(config);
    }


}
